<?php
class Enter_detailModel extends TransDetailModel {
   public function addDetail($data){
       $small_count = count($data['enter_price']);
           $detail_data = array();
           $model = M('Enter_detail');
           for( $i =0 ; $i<$small_count;$i++){
               $detail_data= array(
                   'enter_id'=> $data['enter_id'],
                   'enter_no'=> $data['enter_no'],
                   'product_id'=> $data['product_id'][$i],
                   'enter_price'=> $data['enter_price'][$i],
                   'number'=> $data['number'][$i],
                   'supplier_id'=> $data['supplier_id'][$i],
                   'create_time'=> time(),
               );
              $model ->add($detail_data);
               unset($detail_data);
           }
           return true;
   }
}
?>
